<?php
defined('IN_IA') or exit('Access Denied');
global $_GPC, $_W;
$aouthkey = $_GPC['aouthkey'];
$itemid = $_GPC['itemid'];
$itemurl = $_GPC['itemurl'];
$itemsurl = $_GPC['itemsurl'];
$itemyhj_url = $_GPC['itemyhj_url'];
$isdx = $_GPC['isdx'];
$tktype = $_GPC['tktype'];
$setting = $this->baseset($_W['uniacid']);
$nbkey = $setting['nbkey'];
if ($aouthkey == $nbkey) {
	if (!empty($itemid)) {
	} else {
		exit(json_encode(array('isok' => 'noiteminfo')));
	}
	$list = pdo_fetch("SELECT id,itemid,status FROM " . tablename($this->tableitemall) . " WHERE uniacid = '{$_W['uniacid']}' AND itemid = '{$itemid}'");
	$data = array('uniacid' => $_W['uniacid'], 'displayorder' => 0, 'itemid' => $this->nbde($_GPC['itemid']), 'title' => $this->nbde($_GPC['title']), 'd_title' => $this->nbde($_GPC['d_title']), 'itempic' => $this->nbde($_GPC['itempic']), 'shoptitle' => $this->nbde($_GPC['shoptitle']), 'itemfee' => $_GPC['itemfee'], 'itemfee2' => $_GPC['itemfee2'], 'itemmsell' => $_GPC['itemmsell'], 'itemsurl' => $this->nbde($_GPC['itemsurl']), 'itemurl' => $this->nbde($_GPC['itemurl']), 'itemtkl' => $this->nbde(['itemtkl']), 'itemyhj_zl' => $_GPC['itemyhj_zl'], 'itemyhj_yl' => $$_GPC['itemyhj_yl'], 'itemyhj_tit' => $caiji['itemyhj_tit'], 'itemyhj_stime' => $_GPC['itemyhj_stime'], 'itemyhj_etime' => $_GPC['itemyhj_etime'], 'itemyhj_url' => $this->nbde(['itemyhj_url']), 'itemyhj_tkl' => $this->nbde(['itemyhj_tkl']), 'cate_id' => $_GPC['cate_id'], 'atime' => TIMESTAMP, 'fm' => 'dtk', 'shouru_bili' => $_GPC['shouru_bili'], 'shouru_yongjin' => $_GPC['shouru_yongjin'], 'quan_id' => $_GPC['quan_id'], 'maijia_id' => $_GPC['maijia_id'], 'istmall' => $_GPC['istmall'], 'quan_link' => $this->nbde($_GPC['quan_link']), 'tktype' => $_GPC['tktype'],);
	if ($isdx) {
		$data['isdx'] = $isdx;
	}
	if ($list) {
		$data['status'] = $list['status'];
		pdo_update($this->tableitemall, $data, array('id' => $list['id']));
		exit(json_encode(array('isok' => 1, 'iteminfo' => $list)));
	} else {
		$data['status'] = 1;
		pdo_insert($this->tableitemall, $data);
		exit(json_encode(array('isok' => 'noiteminfo')));
	}
} else {
	exit(json_encode(array('isok' => 'aouthkey error!')));
}